<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../css/style.css"/>       
        <link href="../assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

		<script type="text/javascript">
			window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		

<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="../assets/js/bootstrap.min.js"></script>
		<script src="../assets/js/typeahead-bs2.min.js"></script>
		<!-- page specific plugin scripts -->
		<script src="../assets/js/jquery.dataTables.min.js"></script>
		<script src="../assets/js/jquery.dataTables.bootstrap.js"></script>
        <script type="text/javascript" src="../js/H-ui.js"></script> 
        <script type="text/javascript" src="../js/H-ui.admin.js"></script> 
        <script src="../assets/layer/layer.js" type="text/javascript" ></script>
        <script src="../assets/laydate/laydate.js" type="text/javascript"></script>
        
        <script>
        
        
 
									function zuofei() {

										var a = $("input[type='checkbox']:checked").length;

										
										if (a == 1) {

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

											

											if (id == null || id == "") {
												alert("请选择编号");
											} else {

												var state = document
														.getElementById("st"
																+ id).innerText;
												if (state == '签约') {

													alert("当前状态不可作废");

												} else {
												layer.confirm('确认要作废吗？', function(index) {

					                           /*  $(document.getElementById("s" + id)).remove();
 */
					                           layer.msg('已作废!', {
						                        icon : 1,
						                        time : 1000
					                          });
					                  window.location.href = "../indent/update.do?id="
																				+ id;

				                       });
												

													
																		
																	
												}
											}
										} else {
											alert("该操作只能选中一个");

										}

									}
									
									
									
							
							
				function qianyue() {

										var a = $("input[type='checkbox']:checked").length;

									

										if (a == 1) {

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

										

											if (id == null || id == "") {
												alert("请选择编号");
											} else {

												var state = document
														.getElementById("st"
																+ id).innerText;
												if (state == '认购') {
                                                  
													 window.location.href = "../indent/qianyue.do?id="+id;
													

												} else {
												
					                                 alert("当前状态不可转签约");
				                     					
												}
											}
										} else {
											alert("该操作只能选中一个");

										}

									}						
									
									
							function daochu() {

										var a = $("input[type='checkbox']:checked").length;

									if(a>=1){

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
										    }
										 	
											
											
                                             
								 window.location.href = "../indent/daochu.do?b="+check_val;
											
										

				}else{
				  alert("请选择要导出的信息");
				  
				  
				
				}
				
				
				
				}		
									
									
								</script>
        
        
        
        
<title>订单列表</title>
</head>

<body>
<div class="page-content clearfix">
    <div id="Member_Ratings">
      <div class="d_Confirm_Order_style">
    <div class="search_style">
     <form action="select.do" method="post"> 
      <ul class="search_content clearfix">
       <li><label class="l_f">客户名称：</label><input name="cname" type="text"  class="text_add"/></li>
       <li><label class="l_f">业务员名称：</label><input type="text" name="uname"/></li>
       <li style="width:90px;"><button type="submit" class="btn_search"><!-- <i class="icon-search"></i> -->查询</button></li>
      </ul>
      </form>
      
      
      
    </div>
   
     <div class="border clearfix">
       <span class="l_f">
       <!--  <a href="../indent/add.do" class="btn btn-warning">&nbsp;添加&nbsp;</a> -->
         <%--   <a title="编辑" href="../indent/update.do?uid=${userid}&id=${id}&mid=${list.id}"  class="btn btn-xs btn-info">编辑</a>  --%>
          <a title="作废" href="javascript:;" onclick="zuofei()" class="btn btn-xs btn-warning" >作废</a>
           <a title="作废" href="javascript:;" onclick="daochu()" class="btn btn-xs btn-info" >导出</a> 
        </span>
      <span style="margin-left: 28cm;">
        <a href="javascript:;" class="btn btn-xs btn-success" onclick="qianyue()" ><i class="fa fa-check  bigger-120">转签约</i></a>  
      </span>
     </div>
 
     <div class="table_menu_list">
      <form name="ff">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
	    	<th width="25"><label><input type="checkbox" class="ace" name="ck" id="ck" value=""/><span class="lbl"></span></label></th>
				<th width="80">ID</th>
				<th width="100">房间</th>
				<th width="80">客户名称</th>
				<th width="120">订单编号</th>
				<th width="200">签署日期</th>
				<th width="100">定金</th>            
				<th width="250">协议总价</th>
				<th width="250">业务员</th>
				<th width="250">订单类型</th>
			</tr>
		</thead>
	<tbody>

		
		<c:forEach items="${indentList}" var="list">
		<tr id="t${list.id}">
          <td><label><input type="checkbox" class="ace" name="ck" id="ck" value="${list.id}"/><span class="lbl"></span></label></td>
          <td>${list.id}</td>
          <td>${list.complex}#${list.unit}#${list.roomnumber}</td>
          <td>${list.cname}</td>
          <td>${list.title}</td>
           <td><fmt:formatDate value="${list.createtime}" pattern='yyyy-MM-dd'/></td>
           <td>${list.roomprice}</td>
           <td>${list.roomtotal}</td>
           <td>${list.uname}</td>
           <td id="st${list.id}">${list.state}</td>
		</tr> 
		
		</c:forEach>
      
      </tbody>
	</table>
	</form>
   </div>
  </div>
 </div>
</div>

  
</body>


</html>





